<%@ include file="../header.jsp" %>
<div id="content">
	<table border="1" bgcolor="lightblue">
					<c:forEach items="${questionList}" var="question">
					<tr>
					<th>
						Pregunta:
					</th>
					<td>
						<c:out value="${question.question}" /><br>
						<hr>
						Fecha: <fmt:formatDate type="date" value="${question.date}"/>
						<br>
					</td>
					</tr>
					<c:if test="${question.answer != null }">
					<tr>
					<th>
						Respuesta
					</th>
					<td>
						<c:out value="${question.answer}" />
					</td>
					</tr>
					</c:if>
					<c:if test="${question.answer == null }">
					<tr>
					<th>
						Respuesta
					</th>
					<td>
						<form action="answerQuestion" method="POST">
							<input type="hidden" value="${question.id}" name="id"/>
							<input type="text" name="answer"/>
							<input type="submit">
						</form>
					</td>
					</tr>
					</c:if>
				</c:forEach>
				</table>
</div>
<%@ include file="../footer.jsp" %>